package com.rules.admin.unit.expect;

import com.rules.admin.expression.*;
import com.rules.admin.expression.value.StringValue;


public class ActionExpressionVistor extends ExpressionVisitorAdapter {


   public void vistor(RuleExpression ruleExpression) {
      ExecuteExpression executeExpression = new ExecuteExpression("ActionsHolder", "addAction", new Expression[]{new StringValue(ruleExpression.getRuleName())});
      ruleExpression.getDeduction().getExpressions().add(0, executeExpression);
      super.vistor(ruleExpression);
   }

   public void vistor(RulePackageExpression rulePackageExpression) {
      rulePackageExpression.addImport(new Import("com.gillion.grule.manager.unit.expect.ActionsHolder"));
      super.vistor(rulePackageExpression);
   }
}
